<%@ page language="java" pageEncoding="UTF-8" buffer="16kb"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<%@ include file="/module/js.jsp"%>
<%@ include file="/module/orderField.jsp"%>
     <script type="text/javascript" src="${basePath}/js/jquery.Huploadify.js"></script>
     <link href="${basePath}/css/Huploadify.css" rel="stylesheet">

<style>

table label.error {
    margin-left: 5px;
    width: auto;
    display: inline;
    color: red;
}
</style>







</head>
<body>
     <form action="#" name="Form" id="Form" method="post">
            <input type="hidden" name="knid" id="knid"  value="${data.knid}"/>
            <input type="hidden" name="states" id="states" value="${data.states}"/>
            <input type="hidden" name="bjid" id="bjid"  value="${data.bjid}"/>
            <input type="hidden" name="stuid" id="stuid"  value="${data.stuid}"/>
		   	<table cellpadding="0" cellspacing="0" border="0" class="table-border" width="95%">
			<tr>
				<td class="table-header" colspan="6">困难生认定申请</td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width: 12%">姓名：</td>
				<td class="table-contentTD" style="width: 21%">${data.xm}</td>
				<td class="table-titleTD"  style="width: 12%">学号：</td>
				<td class="table-contentTD" style="width: 21%">${data.xh}</td>
				<td class="table-titleTD" style="width: 12%">性别：</td>
				<td class="table-contentTD" style="width: 22%">${data.xb}</td>
			</tr>
			<tr>
				<td class="table-titleTD">班级：</td>
				<td class="table-contentTD">${data.bjmc}</td>
				<td class="table-titleTD">专业：</td>
				<td class="table-contentTD">${data.zymc}</td>
				<td class="table-titleTD">年级：</td>
				<td class="table-contentTD">${data.njmc}</td>
			</tr>
			
			<tr>
				<td class="table-titleTD">出生日期：</td>
				<td class="table-contentTD">${data.csrq1}</td>
			
				<td class="table-titleTD">民族：</td>
				<td class="table-contentTD"><select id="mz" name="mz"   class="selectList">
						<option value="">请选择</option>
							 <c:forEach items="${nationList}" var="code">
								<option value="${code.codename}">${code.codename}</option>
							</c:forEach>
				</select></td>
				<td class="table-titleTD">政治面貌：</td>
				<td class="table-contentTD"><select id="zzmm" name="zzmm"  class="selectList">
						<option value="">无</option>
						<c:forEach items="${sysCodeList}" var="code">
							  <option value="${code.codename}">${code.codename}</option>
						</c:forEach>
				</select></td>
			</tr>
			
			<tr>
			    <td class="table-titleTD">户口所在地：</td>
			    <td class="table-contentTD">
				<input type="text" name="hjszd" id="hjszd" placeholder="户口所在地"  class="inputText" value="${data.hjszd}"  autocomplete="off"/></td>
			  
			    <td class="table-titleTD">联系电话：</td>
			    <td class="table-contentTD">
				<input type="text" name="lxdh" id="lxdh" placeholder="联系电话"  class="inputText" value="${data.lxdh}"  autocomplete="off"/></td>
				
			</tr>
			
			<tr>
			   <td class="table-titleTD"><font style="color: red;">*</font>申请认定理由：</td>
			   <td colspan="7" class="table-contentTD" style="color: #000000" >
						 <label><input type="checkbox" id="dbz"     name="dbz" value="true" <c:if test="${data.dbz=='true'}">checked="checked"</c:if> />有效期内的低保证（含杭州市困难家庭救助证、低保边缘证）；证号：<input type="text" name="dbzh" id="dbzh" placeholder="请输入" style="width: 30%" value="${data.dbzh}"  class="inputText"  autocomplete="off"/></label><br />
						 <label><input type="checkbox" id="fljgzm"   name="fljgzm" value="true" <c:if test="${data.fljgzm=='true'}">checked="checked"</c:if> />福利机构监护对象证明；</label><br />
						 <label><input type="checkbox" id="gmlszn"  name="gmlszn" value="true" <c:if test="${data.gmlszn=='true'}">checked="checked"</c:if> />革命烈士子女证明；</label><br />
						 <label><input type="checkbox" id="wbgydx"  name="wbgydx" value="true" <c:if test="${data.wbgydx=='true'}">checked="checked"</c:if> />五保供养对象证明；</label><br />
						 <label><input type="checkbox" id="cjz"   name="cjz" value="true"  <c:if test="${data.cjz=='true'}">checked="checked"</c:if> />残疾学生残疾证；证号：<input type="text" name="cjzh" id="cjzh" placeholder="请输入"   class="inputText" style="width: 30%" value="${data.cjzh}"  autocomplete="off"/></label><br />
						 <label><input type="checkbox" id="sqzm"  name="sqzm" value="true" <c:if test="${data.sqzm=='true'}">checked="checked"</c:if> />社区（街道）签署意见并盖章后的《杭州市中等职业学校助学金申请表》及相关收入证明；</label><br />
						 <label><input type="checkbox" id="qtzj"  name="qtzj" value="true" <c:if test="${data.qtzj=='true'}">checked="checked"</c:if> />其他证件（含证号）:<input type="text" name="qtzjsm" id="qtzjsm" placeholder="请输入" value="${data.qtzjsm}" style="width: 30%" class="inputText"  autocomplete="off"/></label>
			    </td>
			</tr>
			<tr>
				<td class="table-titleTD">备注:</td>
				<td class="table-contentTD" colspan="6" style="width: 100%"><textarea style="width: 90%;height: 80px;" name="remark"  autocomplete="off" placeholder="备注" id="remark" maxlength="2000" >${data.remark}</textarea></td>
			</tr>
		</table>
	 </form>
     <br />
		
		    
		<table cellpadding="1" cellspacing="1" border="0" align="left">
			<tr>
			    <td><input type="button" id="btnSave" class="inputButton" style="text-align: center;" value="保存"  autocomplete="off"/></td>
				<td><input type="button" id="Cancel" class="inputButton" style="text-align: center;" value="取消"  autocomplete="off"/></td>
				<td><input type="button" id="returnBut" class="inputButton" value="返回" style="text-align: center;" autocomplete="off"/></td>
			</tr>
		</table>
		
		<script>
		
			$(document).ready(function() {
				var _form=$("#Form").validate();
				$("#btnSave").click(function() {
					if(_form.form()){
						
						var checks =$("input[type='checkbox']");
						var ids = "";
						if(checks&&checks.length>0){
							for(var i=0;i<checks.length;i++){
								if(checks[i].checked){
									if(ids.length>0)ids+=",";
									ids+=checks[i].value;
								}
							}
						}
						if(ids==''){
								layer.alert("请至少选择一个申请认定理由", {icon: 5});
								return false; 
						}
						 validateObj();
					}
				});
				
				
				function validateObj(){
					   var ok=true;
					   if($("#dbz").is(":checked")==true){
						  var dbzh= $("#dbzh").val();
						  if(dbzh==''){
							 layer.alert('有效期内的低保证不能为空', {icon: 5});
							 ok=false;
						     return false;
						  }
					   }
					   if($("#cjz").is(":checked")==true){
							  var cjzh= $("#cjzh").val();
							  if(cjzh==''){
								 layer.alert('残疾学生残疾证号不能为空', {icon: 5});
								 ok=false;
							     return false;
							  }
					   }
					   
					   if($("#qtzj").is(":checked")==true){
							  var qtzjsm= $("#qtzjsm").val();
							  if(qtzjsm==''){
								 layer.alert('其他证件号不能为空', {icon: 5});
								 ok=false;
							     return false;
							  }
					   }
					   if(ok==true){
							    document.Form.action ="${basePath}/zxjDifficultStudent/update";
								document.Form.submit();
					   }
				}
				
				
				
				$("#Cancel").click(function() {
					   window.location.href ="${basePath}/zxjDifficultStudent/details?id="+ $("#knid").val();
		 		});
				
				$("#returnBut").click(function() {
		 			 window.location.href='${basePath}/zxjDifficultStudent/index';
		 		});
			});
			 compareListValue(document.getElementById('zzmm'),'${data.zzmm}');
		     compareListValue(document.getElementById('mz'),'${data.mz}');
		</script>
</body>
</html>
